package org.neuedu.chapter07_0623.demo08;

public class TrainStation {
    double price = 100;

    public void saleTicket(Person person) {
        if (person instanceof Student) {
            System.out.println(price * 0.5);
        } else if (person instanceof Teacher) {
            System.out.println(price * 0.8);
        } else if (person instanceof Worker) {
            System.out.println(price * 0.7);
        }
    }

}
